<template>
	<gui-page ref="guiPage" :customHeader="true">
		<!-- 导航 -->
		<template v-slot:gHeader>
			<nav-bar-custom left-icon="left" :title="$t('taskManagement.agvTask')" @clickLeftBack="clickLeftBack"
				scanType="0"></nav-bar-custom>
		</template>

		<template v-slot:gBody>
			<view class="distributed">
				<view class="gui-bg-white gui-dark-bg-level-3 gui-padding-x distributed-head">
					<view class="gui-form-item gui-border-b">
						<text class="gui-form-label gui-secondary-text" style="width:300rpx">{{
							$t('taskManagement.taskNo') }}：</text>
						<view class="gui-form-body gui-text-right">
							<input type="text" class="gui-form-input gui-text-right" v-model="data.taskNo"
								:placeholder="$t('taskManagement.pleaseEnter')" />
						</view>
					</view>
					<!-- <view class="gui-form-item gui-border-b">
						<text class="gui-form-label gui-secondary-text" style="width:300rpx">{{
							$t('taskManagement.agvNo') }}：</text>
						<view class="gui-form-body gui-text-right">
							<input type="text" class="gui-form-input gui-text-right" v-model="data.agvNo"
								:placeholder="$t('taskManagement.pleaseEnter')" />
						</view>
					</view> -->
					<view class="gui-form-item gui-border-b">
						<text class="gui-form-label gui-secondary-text" style="width:300rpx">{{
							$t('taskManagement.tastStatus') }}：</text>
						<view class="gui-form-body gui-text-right" style="overflow: visible;">
							<superweiCombox style="text-align: right;" :candidates="data.selectList"
								:placeholder="$t('distributedOut.placeholder')" :isJSON="true" keyName="name"
								@select="select" v-model="data.selectText" :defaultValue="$t('smashRemoval.all')">
							</superweiCombox>
						</view>
					</view>
					<view class="gui-form-item gui-border-b">
						<text class="gui-form-label gui-secondary-text">{{ $t('distributedEnter.date') }}：</text>
						<view class="gui-form-body gui-text-right" @click="dateChoose">
							<view class="gui-form-input gui-text-right" v-if="data.chooseTime.length > 0">
								<text>{{ data.chooseTime[0] }}</text> <text v-if="data.chooseTime[1]"> -
									{{ data.chooseTime[1] }}</text>
							</view>
							<input v-else type="button" class="gui-form-input gui-text-right"
								:placeholder="$t('distributedEnter.placeholderTextChoose')" />
						</view>
					</view>
					<!-- 按钮 -->
					<view class="gui-form-item gui-border-b gui-flex gui-justify-content-center">
						<view class="gui-flex gui-space-between gui-align-items-center"
							style="width: 70%;height: 100rpx;">
							<button type="default" class="gui-button gui-button-mini gui-bg-black4 gui-noborder"
								style="width:200rpx;" @click="reset">
								<text class="gui-block gui-color-black gui-button-text-mini gui-icons">{{
									$t('distributedEnter.reset') }}</text>
							</button>
							<button type="default" class="gui-button gui-button-mini gui-bg-blue gui-noborder"
								style="width:200rpx;" @click="search">
								<text class="gui-block gui-color-white gui-button-text-mini gui-icons">{{
									$t('taskManagement.inquire') }}</text>
							</button>
							<button type="default" class="gui-button gui-button-minigui-noborder" v-if="false"
								style="width:200rpx;background-color:#ff6c00;border:#ff6c00 1px solid !important;"
								@click="advancedQuery">
								<text class="gui-block gui-color-white gui-button-text-mini gui-icons">{{
									$t('taskManagement.advancedQuery') }}</text>
							</button>
						</view>
					</view>
				</view>
				<!-- 中间tab栏 -->
				<view class="tabList">
					<view class="tabs__nav-scroll">
						<view class="el-tabs__nav">
							<view :class="data.tabSelect == index ? 'el-tabs__item is_active' : 'el-tabs__item'"
								v-for="(item, index) in data.tabList" :key="index" @click="tabSelectFn(item, index)">
								{{ item.name }}<text style="margin-left:10rpx">({{ getCount(index) }})</text></view>
						</view>
					</view>
				</view>
				<!-- 内容 -->
				<scroll-view :show-scrollbar="false" :scroll-y="true" class="scroll" @scrolltolower="scrolltolowerFn">
					<view style="height: 15rpx"></view>
					<view class="card-boxCustom" v-for="(x, i) in data.list" @click="goPage(x)" :key="i">
						<view class="card-head">
							<text>{{ $t('taskManagement.taskNo') }}：{{ x.taskCode }}</text>
							<gui-tags v-if="x.taskStatusStr == '未完成'" :text="$t('taskManagement.inExecution')"
								:customClass="['gui-transparent-bg', 'gui-color-blue']" :width="80" :lineHeight="2.5"
								:size="12" borderColor="#008AFF"></gui-tags>
							<gui-tags v-else-if="x.taskStatusStr == '已完成'" :text="$t('distributedEnter.statusOk')"
								:customClass="['gui-transparent-bg', 'gui-color-green']" :width="80" :lineHeight="2.5"
								:size="12" borderColor="#39B55A"></gui-tags>
							<gui-tags v-else-if="x.taskStatusStr == '等待'" :text="$t('taskManagement.await')"
								:customClass="['gui-transparent-bg', 'gui-color-yellow']" :width="80" :lineHeight="2.5"
								:size="12" borderColor="#f0ad4e"></gui-tags>
							<gui-tags v-else-if="x.taskStatusStr == '创建'" :text="$t('taskManagement.establish')"
								:customClass="['gui-transparent-bg', 'gui-color-red']" :width="80" :lineHeight="2.5"
								:size="12" borderColor="#dd524d"></gui-tags>
							<gui-tags v-else-if="x.taskStatusStr == '提交'" :text="$t('calendar.submit')"
								:customClass="['gui-transparent-bg', 'gui-color-orange']" :width="80" :lineHeight="2.5"
								:size="12" borderColor="#37886C"></gui-tags>
							<gui-tags v-else-if="x.taskStatusStr == '等待步骤执行'" :text="$t('taskManagement.await')"
								:customClass="['gui-transparent-bg', 'gui-color-orange']" :width="80" :lineHeight="2.5"
								:size="12" borderColor="#dfcd34"></gui-tags>
							<gui-tags
								v-else-if="x.taskStatusStr == '允许放货' || x.taskStatusStr == '允许取货' || x.taskStatusStr == '到达放货关键点' || x.taskStatusStr == '执行中' || x.taskStatusStr == '取货完成'"
								:text="$t('taskManagement.inExecution')"
								:customClass="['gui-transparent-bg', 'gui-color-orange']" :width="80" :lineHeight="2.5"
								:size="12" borderColor="#dfcd34"></gui-tags>
							<gui-tags v-else :text="$t('Common.cancel')"
								:customClass="['gui-transparent-bg', 'gui-color-gray']" :width="80" :lineHeight="2.5"
								:size="12" borderColor="#C8C9CC"></gui-tags>
						</view>
						<view class="card-body" style="padding-bottom: 15rpx;">
							<!-- 展开按钮 -->
							<view class="card-rotating card-rotating-top" @click.stop="openClick(i)">
								<!-- <uni-icons type="bottom" color="#9C9C9C" size="20"></uni-icons> -->
								<uni-icons v-if="!data.listShow[i]" type="bottom" color="#9C9C9C" size="20"></uni-icons>
								<uni-icons v-if="data.listShow[i]" type="top" color="#9C9C9C" size="20"></uni-icons>
							</view>
							<!-- card的内容 -->
							<view class="card-body-item">
								<text class="body-item-title">{{ $t('taskManagement.taskType')
								}}：</text>{{ x.businessTaskTypeName }}
							</view>
							<view class="card-body-item">
								<text class="body-item-title">{{ $t('taskManagement.palletType')
								}}：</text>{{ x.cartonType }}
							</view>
							<view class="card-body-item">
								<text class="body-item-title">{{ $t('finishedInventory.creationTime')
								}}：</text>{{ x.createTime }}
							</view>
							<view class="card-body-item">
								<text class="body-item-title">{{ $t('taskManagement.completionTime')
								}}：</text>{{ x.taskCompleteTime }}
							</view>
							<view class="card-body-item">
								<text class="body-item-title">{{ $t('taskManagement.transportedQty') }}：</text>{{ x.qty
								}}
							</view>
							<view class="card-body-item">
								<text class="body-item-title">{{ $t('taskManagement.priority')
								}}：</text>{{ x.initPriority }}
							</view>
							<view class="card-body-item">
								<text class="body-item-title">{{ $t('mexico.scanType') }}：</text>{{ x.scanType }}
							</view>
							<view class="card-body-item">
								<text class="body-item-title">{{ $t('taskManagement.agvNo') }}：</text>{{ x.robotCode }}
							</view>
						</view>
						<!-- 多个物料的时候有展开,一个的时候没有下面的模块,包括展开按钮都不需要 -->
						<view class="card-body-folding" v-show="data.listShow[i]" v-if="x.listDetails.length > 0">
							<view class="gui-border-t gui-padding" v-for="(item, i) in x.listDetails" :key="i">
								<view class="card-body-item">
									<view class="card-item-50" style="width: 100%;">
										<text class="body-item-title">{{ $t('taskManagement.pick-upLocation')
										}}：</text>{{ item.fromLocationName }}
									</view>
								</view>
								<view class="card-body-item">
									<view class="card-item-50" style="width: 100%;">
										<text class="body-item-title">{{ $t('taskManagement.unloadingPosition')
										}}：</text>{{ item.toLocationName }}
									</view>
								</view>
								<view class="card-body-item">
									<view class="card-item-50" style="width: 100%;">
										<text class="body-item-title">{{ $t('taskManagement.unloadingPositionQty')
										}}：</text>{{ item.existQty }}
									</view>
								</view>
								<view class="card-body-item">
									<view class="card-item-50" style="width: 100%;">
										<text class="body-item-title">{{ $t('distributedEnter.materialCode')
										}}：</text>{{ item.materialCode }}
									</view>
								</view>
								<view class="card-body-item">
									<view class="card-item-50" style="width: 100%;">
										<text class="body-item-title">{{ $t('distributedEnter.materialName')
										}}：</text>{{ item.materialName }}
									</view>
								</view>
								<view class="card-body-item">
									<view class="card-item-50" style="width: 100%;">
										<text class="body-item-title">{{ $t('taskManagement.palletNo')
										}}：</text>{{ item.cartonNo }}
									</view>
								</view>
								<!-- 按鈕 -->
								<view class="card-body-item" style="margin-top: 15rpx;text-align: right;">
									<view class="card-item-10" style="text-align: right;"></view>
									<view class="card-item-20" style="text-align: right;"
										v-if="x.taskStatusStr == '创建'">
										<view class="print-class" @click.stop="submitItem(x)">
											{{ $t('calendar.submit') }}
										</view>
									</view>
									<view class="card-item-20" style="text-align: right;"
										v-if="x.taskStatusStr == '创建'">
										<view class="print-class" style="background-color:#f56c6c"
											@click.stop="deleteItem(x)">
											{{ $t('slottedAsh.delete') }}
										</view>
									</view>
									<view class="card-item-20" style="text-align: right;"
										v-if="x.taskStatusStr != '创建' && x.taskStatusStr != '已完成' && x.taskStatusStr != '已取消'">
										<view class="print-class" style="background-color:#C8C9CC"
											@click.stop="cancelItem(x)">
											{{ $t('Common.cancel') }}
										</view>
									</view>
									<view class="card-item-30" style="text-align: right;"
										v-if="x.taskStatusStr != '创建' && x.taskStatusStr != '已完成' && x.taskStatusStr != '已取消'">
										<view class="print-class" style="background-color:#e6a23c"
											@click.stop="changDestinationItem(x)">
											{{ $t('taskManagement.changDestination') }}
										</view>
									</view>
									<view class="card-item-30" style="text-align: right;"
										v-if="x.taskStatusStr != '创建' && x.taskStatusStr != '已完成' && x.taskStatusStr != '已取消'">
										<view class="print-class" style="background-color:#c3ac33"
											@click.stop="changePriorityItem(x)">
											{{ $t('taskManagement.changePriority') }}
										</view>
									</view>
								</view>
							</view>
						</view>
					</view>
					<view v-if="data.noticeHooks" class="noticeHooks">
						{{ data.list.length == 0 ? $t('stockManage.notAvailable') : $t('stockManage.without') }}
					</view>
				</scroll-view>
				<!-- 底部按钮 -->
				<view class="page-bottom-box bottom-postion">
					<view class="page-bottomBtn bottomBtn-bgcolor-green" @click="createTasks">
						{{ $t('taskManagement.createTasks') }}
					</view>
				</view>
			</view>
			<calendarCustom ref="calendarCustomRef" @setTime="getTime" :selectTime="data.chooseTime"></calendarCustom>
		</template>
	</gui-page>
</template>

<script setup>
//引入文件
import { ref, reactive, onMounted, computed, watch, toRaw } from "vue";
import pdaScan from '@/hooks/pdaScan.js';
import searchCustom from '@/components/searchCustom';
import calendarCustom from '@/components/calendarCustom';
import superweiCombox from '@/components/superweiCombox';
import openView from '@/components/common/openView';
import { onShow } from '@dcloudio/uni-app';
import { onBackPress } from '@dcloudio/uni-app';
import { navigate } from '@/utils/routerSkip.js';
import { useStore } from "vuex";
import { basPdaOperationLogFn } from '@/utils/index.js';
import { OPERATION_COMMIT, OPERATION_SCAN, OPERATION_CANCEL, OPERATION_DEL, DEFAULT_WAREHOUSENAME, DEFAULT_WAREHOUSEID, BIGBARCODER_PRINT, OPERATION_LOOK } from '@/constant/index.js';
import { getTaskInfo, cancelTaskByTaskCode, delTaskByTaskCode, submitTaskByTaskCode } from '@/api/api.js'

//JS国际化引入
import { useI18n } from 'vue-i18n';
//注册组件
components: {
	searchCustom,
		superweiCombox,
		calendarCustom,
		openView
}
const { t } = useI18n();

let store = useStore();
const { scan } = pdaScan();
let calendarCustomRef = ref(null);



const data = reactive({
	taskNo: '',
	agvNo: '',
	chooseTime: [],
	selectText: t('smashRemoval.all'),
	selectList: [{
		id: '全部',
		name: t('smashRemoval.all')
	}
		, {
		id: '执行',
		name: t('taskManagement.execute')
	}, {
		id: '完成',
		name: t('translationImage.accomplish')
	}, {
		id: '取消',
		name: t('calendar.cancel')
	}],
	// tab数据
	tabSelect: 0,
	tabName: t('smashRemoval.all'),
	tabList: [{
		id: '全部',
		name: t('smashRemoval.all')
	},
	{
		id: '执行',
		name: t('taskManagement.execute')
	},
	{
		id: '完成',
		name: t('translationImage.accomplish')
	},
	{
		id: '取消',
		name: t('calendar.cancel')
	}],
	page: 1,
	size: 20,
	isFinish: false,
	isLoading: false,
	noticeHooks: false, //暂无相关数据标识
	list: [],
	listShow: [],
	total0: 0,
	total1: 0,
	total2: 0,
	total3: 0,
})
const total = computed(() => {

	if (data.tabSelect == 0) {
		return data.total0;
	}

	if (data.tabSelect == 1) {
		return data.total1;
	}


	if (data.tabSelect == 2) {
		return data.total2;
	}

	if (data.tabSelect == 3) {
		return data.total3;
	}
})
onMounted(() => {

})

onShow(() => {
	getSystemTimeRequest()
})

// 校验 状态的选择事件
const select = (e) => {
	console.log(e)
	data.selectId = e.id;
	if (data.selectId == '全部') {
		data.tabSelect = 0;
	} else if (data.selectId == '执行') {
		data.tabSelect = 1;
	} else if (data.selectId == '完成') {
		data.tabSelect = 2;
	} else {
		data.tabSelect = 3;
	}
	selectTaskFn()
}
// 时间选择
const getSystemTimeRequest = () => {
	store.dispatch('getSystemTimeRequest')
		.then(res => {
			if (res.length) {
				let a = dataTime(res)
				data.chooseTime = [a, res]
				selectTaskFn()
			}
		})
}

// 进入页面默认日期
const dataTime = (a) => {
	let end = (new Date(a).getTime() / 1000) - (60 * 60 * 24 * 7)
	let lastDate = new Date(parseInt(end) * 1000).getFullYear() + "-" + (new Date(parseInt(end) * 1000).getMonth() + 1) + "-" + new Date(parseInt(end) * 1000).getDate()
	return lastDate
}
const dateChoose = () => {
	calendarCustomRef.value.open();
}
const getTime = (times) => {
	data.chooseTime = times;
}

// 重置
const reset = () => {
	data.taskNo = ''
	data.agvNo = ''
	data.selectText = t('smashRemoval.all');//t('smashRemoval.all')国际化全部
	data.chooseTime = []
	data.tabSelect = 0
}

const getCount = (index) => {
	if (index == 0) {
		return data.total0;
	}

	if (index == 1) {
		return data.total1;
	}


	if (index == 2) {
		return data.total2;
	}

	if (index == 3) {
		return data.total3;
	}
}

// 查詢
const search = () => {
	selectTaskFn()
}
const selectTaskFn = () => {
	let start = ''
	let end = ''
	if (data.chooseTime.length > 0) {
		start = data.chooseTime[0] + ' 00:00:00'
		end = data.chooseTime[1] ? data.chooseTime[1] + ' 23:59:59' : (data.chooseTime[0] || '') + ' 23:59:59'
	}
	let parmes = {
		beginTime: start,
		endTime: end,
		agvCode: data.agvNo,//AGV编号
		taskCode: data.taskNo, //任务编号
		robotTaskCode: '',// 任务类型
		taskStatus: data.selectId,// 任务状态
		taskType: '',// 任务类型，一般是搬运
		fromProcessCode: '',//取货地工序code
		fromLocationCode: '',//取货地位置code
		fromLineCode: '',//取货地线别code
		toProcessCode: '',//放货地工序code
		toLineCode: '',//放货地线别code
		toLocationCode: '',//放货地位置code
		materialCode: '',//物料号 多个之间用; 隔开
		cartonCode: '',//托盘号
		cartonType: '',//托盘类型 WoodCarton48  48 英寸木托盘 / WoodCarton60  60 英寸木托盘 
		priority: '',//任务优先级
		pageNo: data.page,
		pageSize: data.size,
	}
	getTaskInfo(parmes).then(res => {
		try {
			let inputParameter = JSON.stringify(parmes)
			let returnParameter = JSON.stringify(res)
			let operationPicture = 'AGV任务管理'
			let callInterface = res.rquestUrl
			let opertionParmes = {
				inputParameter,
				returnParameter,
				operationPicture,
				callInterface,
				responseCode: res.code,//返回状态
				errorMessage: res.message,//错误信息
				isPass: res.code == 200 ? 'Y' : 'N',//是否成功 Y N
				operationType: OPERATION_LOOK,
				module: 'WMS',
				source: "PDA",
			}
			basPdaOperationLogFn(opertionParmes)
		} catch (error) {
		}
		data.isLoading = false;
		if (res.code == 200) {
			const { items } = res.result;
			data.noticeHooks = false
			if (items.length) {
				items.forEach(x => {
					items.listShow = false
					// 添加展開的按鈕
					x.listDetails = [{
						fromLocationName: x.fromLocationName,
						toLocationName: x.toLocationName,
						existQty: x.existQty,
						materialCode: x.materialCode,
						materialName: x.materialName,
						cartonNo: x.cartonNo,
					}]
				})
			}
			if (data.page == 1) {
				if (items.length == 0) {
					data.noticeHooks = true
				}
				data.list = items
			} else {
				data.list.push(...items)
			}
			data.noticeHooks = data.list.length >= res.result.total;
			data.isFinish = data.list.length >= res.result.total;


			if (data.tabSelect == 0) {

				data.total0 = res.result.total
			}

			if (data.tabSelect == 1) {

				data.total1 = res.result.total
			}
			if (data.tabSelect == 2) {

				data.total2 = res.result.total
			}

			if (data.tabSelect == 3) {

				data.total3 = res.result.total
			}
		} else {
			uni.showToast({ title: res.message, icon: 'none' })
		}
	})
}

// 小三角展开
const openClick = (index) => {
	data.listShow[index] = !data.listShow[index]
}
// 下拉加载
const scrolltolowerFn = () => {
	if (!data.isFinish && !data.isLoading) {
		data.page++
		data.isLoading = true;
		selectTaskFn()
	}
}

// tab切换
const tabSelectFn = (item, index) => {
	console.log(item)
	data.tabSelect = index
	data.selectId = item.id
	data.tabName = item.name
	// data.selectList= item.name
	data.selectText = item.name
	// data.chooseTime=[]
	data.listShow = []
	selectTaskFn()
}
// 高級查詢
const advancedQuery = () => {
	navigate({
		url: '/pages/IOTScanning/advancedQuery'
	})
}
// 任务详情
const goPage = (x) => {
	navigate({
		url: `/pages/IOTScanning/taskDetails?id=${x.taskCode}`
	})
}
// 创建任务
const createTasks = () => {
	navigate({
		url: '/pages/IOTScanning/createTask'
	})
}

// 明细的点击事件 提交 删除 取消 变更优先级和目的地
// 提交
const submitItem = (x) => {
	let parmes = {
		taskCode: x.taskCode
	}
	submitTaskByTaskCode(parmes).then(res => {
		try {
			let inputParameter = JSON.stringify(parmes)
			let returnParameter = JSON.stringify(res)
			let operationPicture = 'AGV任务管理'
			let callInterface = res.rquestUrl
			let opertionParmes = {
				inputParameter,
				returnParameter,
				operationPicture,
				callInterface,
				responseCode: res.code,//返回状态
				errorMessage: res.message,//错误信息
				isPass: res.code == 200 ? 'Y' : 'N',//是否成功 Y N
				operationType: OPERATION_COMMIT,
				module: 'WMS',
				source: "PDA",
			}
			basPdaOperationLogFn(opertionParmes)
		} catch (error) {
		}
		if (res.code == 200) {
			uni.showToast({ title: ('taskManagement.submitSucceeded'), icon: 'none' })
			selectTaskFn()
		} else {
			uni.showToast({ title: res.message, icon: 'none' })
		}
	})
}
//  刪除
const deleteItem = (x) => {
	let parmes = {
		taskCode: x.taskCode
	}
	delTaskByTaskCode(parmes).then(res => {
		try {
			let inputParameter = JSON.stringify(parmes)
			let returnParameter = JSON.stringify(res)
			let operationPicture = 'AGV任务管理'
			let callInterface = res.rquestUrl
			let opertionParmes = {
				inputParameter,
				returnParameter,
				operationPicture,
				callInterface,
				responseCode: res.code,//返回状态
				errorMessage: res.message,//错误信息
				isPass: res.code == 200 ? 'Y' : 'N',//是否成功 Y N
				operationType: OPERATION_DEL,
				module: 'WMS',
				source: "PDA",
			}
			basPdaOperationLogFn(opertionParmes)
		} catch (error) {
		}
		if (res.code == 200) {
			uni.showToast({ title: ('taskList.deleteSucceededt'), icon: 'none' })
			selectTaskFn()
		} else {
			uni.showToast({ title: res.message, icon: 'none' })
		}
	})
}
// 取消
const cancelItem = (x) => {
	let parmes = {
		taskCode: x.taskCode
	}
	cancelTaskByTaskCode(parmes).then(res => {
		try {
			let inputParameter = JSON.stringify(parmes)
			let returnParameter = JSON.stringify(res)
			let operationPicture = 'AGV任务管理'
			let callInterface = res.rquestUrl
			let opertionParmes = {
				inputParameter,
				returnParameter,
				operationPicture,
				callInterface,
				responseCode: res.code,//返回状态
				errorMessage: res.message,//错误信息
				isPass: res.code == 200 ? 'Y' : 'N',//是否成功 Y N
				operationType: OPERATION_CANCEL,
				module: 'WMS',
				source: "PDA",
			}
			basPdaOperationLogFn(opertionParmes)
		} catch (error) {
		}
		if (res.code == 200) {
			uni.showToast({ title: t('taskManagement.cancelSucceeded'), icon: 'none' })
			selectTaskFn()
		} else {
			uni.showToast({ title: res.message, icon: 'none' })
		}
	})
}
// 变更目的地
const changDestinationItem = (x) => {
	navigate({
		url: `/pages/IOTScanning/changeOfDestination?id=${x.taskCode}`
	})
}
// 优先级
const changePriorityItem = (x) => {
	navigate({
		url: `/pages/IOTScanning/changePriority?id=${x.taskCode}`
	})
}

//导航栏左侧返回
const clickLeftBack = () => {
	navBackCheck()
}
const navBackCheck = () => {
	uni.navigateBack({
		delta: 1
	});
}
//点击物理按键的返回
onBackPress((options) => {
	if (options.from == 'backbutton') {
		uni.navigateBack({
			delta: 1
		});
		return true;
	}
})

</script>

<style scoped lang="scss">
.tabList {
	height: 80rpx;
	margin: 10rpx 0 10rpx;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	background-color: #fff;
	box-sizing: border-box;

	.tabs__nav-scroll {
		width: 100%;
		padding: 0 20rpx;
		border-bottom: 4rpx solid #E4E7ED;
		box-sizing: border-box;
		overflow-y: auto;

		.el-tabs__nav {
			display: flex;
			white-space: nowrap;
			position: relative;
			transition: transform .3s;
			float: left;

			.el-tabs__item {
				padding: 0 20px;
				height: 80rpx;
				box-sizing: border-box;
				display: flex;
				align-items: center;
				justify-content: center;
				list-style: none;
				font-size: 14px;
				font-weight: 500;
				color: #303133;
				position: relative;
			}
		}
	}
}

.is_active {
	color: #409eff !important;
	border-bottom: 4rpx solid #409EFF !important;
}

.distributed-head {
	border-bottom-left-radius: 16rpx;
	border-bottom-right-radius: 16rpx;
}

.scroll {
	flex: 1;
	height: 2rpx;
}

.distributed {
	display: flex;
	flex-direction: column;
	height: calc(100vh - 88rpx);
	// height: 100vh;
}

.card-box {
	margin: 0 15rpx;
	box-shadow: 0rpx 0rpx 4rpx 0 #A5A5A5;
	background: #fff;
	padding: 30rpx;
	border-radius: 16rpx;
}

.card-item {
	line-height: 60rpx;
}

.card-bottom {
	margin-bottom: 30rpx;
}

.filtrate-item {
	display: flex;
	align-items: center;
	font-size: 32rpx;
	margin-bottom: 20rpx;

	.filtrate-itemLeft {
		height: 32rpx;
		line-height: 32rpx;
		width: 100rpx;
	}

	.filtrate-itemRight {
		border: 2rpx solid #A5A5A5;
		border-radius: 8rpx;
		overflow: hidden;
		line-height: 40rpx;
		width: 300rpx;
	}
}

.card-rotating-top {
	margin-top: 10rpx;
}

.card-selectCustom {
	margin: 0.46875rem 0.625rem;
	box-shadow: 0 0 0.125rem 0 #a5a5a5;
	background: #fff;
	padding: 0.375rem 0.75rem;
	border-radius: 0.5rem;
	position: relative;
	height: 70rpx;
}

.print-class {
	display: inline-block;
	padding: 10rpx 20rpx;
	background-color: $uni-color-teal;
	color: #fff;
	border-radius: 8rpx;
}
</style>
